package csel.view;

import java.awt.Container;

import csel.model.*;
import csel.view.area.AreaViewPanel;

/**
 * Provides an interface for the display of the currently viewable area. 
 * @author david
 */
public class AreaViewport extends Viewport
{
	final Model model;
	final TrampolineListener listener;
	final AreaViewPanel panel;

	public AreaViewport(Model model, TrampolineListener listener)
	{
		this.model = model;
		
		this.listener = listener;
		
		panel = new AreaViewPanel(model);
	}
	
	@Override
	public void close()
	{
		panel.stopRenderer();
		System.out.println("[VIEW] AreaViewport closed.");
	}

	@Override
	public void setVisible(boolean visibility)
	{

		panel.setVisible(visibility);
	}

	public void startRendering()
	{
		panel.startLoop();
	}

	@Override
	protected Container getContainer()
	{
		return panel;
	}
}
